package com.huadao.pda.common.dialog.effects;

import android.content.DialogInterface;

import com.huadao.pda.R;
import com.huadao.pda.common.dialog.RockCallBack;


public class RockButtonAttr {
    private String text;
    private int bgResId = R.drawable.btn_blue_bg;
    private RockCallBack rockCallBack;
    private int nature = BUTTON_NEUTRAL;
    //TypedValue.COMPLEX_UNIT_PX
    private int textSize;

    public static int BUTTON_NEGATIVE = DialogInterface.BUTTON_NEGATIVE;
    public static int BUTTON_POSITIVE = DialogInterface.BUTTON_POSITIVE;
    public static int BUTTON_NEUTRAL = DialogInterface.BUTTON_NEUTRAL;

    public RockButtonAttr(String text, RockCallBack rockCallBack) {
        this.text = text;
        this.rockCallBack = rockCallBack;
    }

    public RockButtonAttr(String text, int nature, RockCallBack rockCallBack) {
        this.text = text;
        this.nature = nature;
        this.rockCallBack = rockCallBack;
        initBgResIdByNature();
    }

    public RockButtonAttr(String text, int nature, int bgResId, RockCallBack rockCallBack) {
        this.text = text;
        this.bgResId = bgResId;
        this.rockCallBack = rockCallBack;
        this.nature = nature;
    }

    private void initBgResIdByNature() {
        if (nature == BUTTON_POSITIVE) {
            bgResId = R.drawable.btn_blue_bg;
        } else if (nature == BUTTON_NEGATIVE) {
            bgResId = R.drawable.btn_red_bg;
        } else {
            bgResId = R.drawable.btn_blue_bg;
        }
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getBgResId() {
        return bgResId;
    }

    public void setBgResId(int bgResId) {
        this.bgResId = bgResId;
    }

    public RockCallBack getRockCallBack() {
        return rockCallBack;
    }

    public void setRockCallBack(RockCallBack rockCallBack) {
        this.rockCallBack = rockCallBack;
    }

    public int getTextSize() {
        return textSize;
    }

    public void setTextSize(int textSize) {
        this.textSize = textSize;
    }

    public int getNature() {
        return nature;
    }

    public void setNature(int nature) {
        this.nature = nature;
    }
}
